package com.sgb.merchant;

import android.os.Bundle;

import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.sgb.merchant.view.fragment.MerchantHomeFragment;
import com.swgk.core.base.permission.MPermission;
import com.swgk.core.common.base.BaseActivity;


public class MainActivity extends BaseActivity {
    private static final int BASIC_PERMISSION_REQUEST_CODE = 100;
    public static final String[] BASIC_EXTERNAL_STORAGE = new String[]{
            android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
            android.Manifest.permission.READ_EXTERNAL_STORAGE
    };
    @Override
    protected int layoutId() {
        return R.layout.merchant_activity_main;
    }

    @Override
    protected void createViewModel() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MPermission.printMPermissionResult(true, this, BASIC_EXTERNAL_STORAGE);
        MPermission.with(this)
                .setRequestCode(BASIC_PERMISSION_REQUEST_CODE)
                .permissions(BASIC_EXTERNAL_STORAGE)
                .request();
        FragmentManager manager = getSupportFragmentManager();
        FragmentTransaction transaction = manager.beginTransaction();
        transaction.add(R.id.ll_main, MerchantHomeFragment.newInstance());
        transaction.commit();
    }

    @Override
    protected void init() {

    }
}